class CateaddModal extends React.Component {
    constructor(props) {
  super(props);
  this.state = {
    gysm:this.props.gysm
   };
    }


    click(){
        this.props.click(this.state.gysm)
    }
    
    componentWillReceiveProps(e){ 
      this.setState({gysm:e.gysm,title:e.title,type:e.type}) 
      
    }
    change(e){
      this.setState({gysm:e.target.value})
    }
componentDidMount() {
var that = this;
}
     render() {
            return(
                <div className="modal" id="CateaddModal">
 <div className="modal-dialog modal-sm">
   <div className="modal-content add">

     <div className="modal-header">
       <h4 className="modal-title">{this.state.title}</h4>
              </div>
     <div className="modal-body">
      {/* <textarea onChange={this.change.bind(this)} value={this.state.gysm} name="" id="" cols="30" rows="10"></textarea> */}
      <input placeholder="请输入名字" onChange={this.change.bind(this)} value={this.state.name}  />
     </div>
     <div className="modal-body">
      {/* <textarea onChange={this.change.bind(this)} value={this.state.gysm} name="" id="" cols="30" rows="10"></textarea> */}
      <input placeholder="请输入排序" onChange={this.change.bind(this)} value={this.state.orders}  />
     </div>
     <div className="modal-footer">
       <button type="button" onClick={this.click.bind(this)}  className="btn btn-primary">确定</button>
       <button type="button" className="btn btn-secondary" data-dismiss="modal">关闭</button>
     </div>

   </div>
  </div>
</div>
            )
        }
    }